/**
 *
 * @description: 获取排名前12本书
 * @author: junyong.hong
 * @createTime: 2018/6/11
 * @version: 1.0.0.0
 * @history:
 *    1、
 *    2、
 *
 */
const { mysql } = require('../qcloud')

module.exports = async (ctx) => {
    const top = await mysql('books')
    .select('id', 'title', 'image', 'count')
    .orderBy('count', 'desc')
    .limit(9)

    ctx.state.data = {
        list: top
    }
}
